package com.woniu.customer.exception;

import com.woniu.common.entity.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;


@Slf4j
@RestControllerAdvice
public class GlobalExceptionHandle{
    @ExceptionHandler(IllegalStateException.class)
    public Result noTokenException(IllegalStateException e) {
        System.out.println("发生异常");
        e.printStackTrace();
        return new Result(402, "无效，请重新登录", null);
    }
    @ExceptionHandler(ftpnoconnectionexception.class)
    public Result ftpnoconnectionException(ftpnoconnectionexception e) {
        System.out.println("ftp连接异常");
        e.printStackTrace();
        return new Result(403, "Ftp连接失败", null);
    }
}
